﻿using System;
using System.Management;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace SerialportSample
{
    static class Program
    {


        [STAThread]
        static void Main()
        {
            //List<string> strs = new List<string>();
            //try
            //{
            //    using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from " + HardwareEnum.Win32_PnPEntity))
            //    {
            //        var hardInfos = searcher.Get();
            //        foreach (var hardInfo in hardInfos)
            //        {
            //            if (hardInfo.Properties["Name"].Value.ToString().Contains("COM"))
            //            {
            //                strs.Add(hardInfo.Properties["Name"].Value.ToString());
            //            }

            //        }
            //        searcher.Dispose();
            //    }
            //}
            //catch (ManagementException e)
            //{
            //    System.Diagnostics.Debug.WriteLine("An error occurred while querying for WMI data: " + e.Message);
            //}

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


           Application.Run(new FormMain());
        }
    }
}
